package 实践.class_03;

import java.util.Scanner;

public class Demo_01 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] n = scanner.nextLine().split(" ");
        int max=0,maxtag=0,min=0,mintag=0;
        int [] a = new int[n.length];
        for (int i = 0; i < n.length; i++) {
            a[i]=Integer.parseInt(n[i]);
        }
        for (int i = 0; i < n.length; i++) {
            if (i == 0) {
                min = a[i];
            }
            if (max < a[i]) {
                max = a[i];
                maxtag = i;
            }
            if (min > a[i]) {
                min = a[i];
                mintag = i;
            }
        }
        System.out.println(max+" "+maxtag);
        System.out.println(min+" "+mintag);
    }
}
